To cause pain to someone.
Her elbow has been giving her grief.
To hassle or abuse someone.
Fred was giving me grief over the money I owed him.